<?php



/**
 * This class defines the structure of the 'estimated_budgets' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    propel.generator.damages.map
 */
class DamagesEstimatedBudgetsTableMap extends TableMap
{

    /**
     * The (dot-path) name of this class
     */
    const CLASS_NAME = 'damages.map.DamagesEstimatedBudgetsTableMap';

    /**
     * Initialize the table attributes, columns and validators
     * Relations are not initialized by this method since they are lazy loaded
     *
     * @return void
     * @throws PropelException
     */
    public function initialize()
    {
        // attributes
        $this->setName('estimated_budgets');
        $this->setPhpName('EstimatedBudgets');
        $this->setClassname('DamagesEstimatedBudgets');
        $this->setPackage('damages');
        $this->setUseIdGenerator(true);
        // columns
        $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, 4, null);
        $this->addForeignKey('CAR_DAMAGE_ID', 'CarDamageId', 'INTEGER', 'car_damages', 'ID', true, 4, null);
        $this->addForeignKey('ATTACHMENT_ID', 'AttachmentId', 'INTEGER', 'attachments', 'ID', true, 4, null);
        $this->addColumn('VALUE', 'Value', 'DECIMAL', true, 20, null);
        $this->addColumn('DISCOUNT_FLAG', 'DiscountFlag', 'TINYINT', true, 1, 0);
        $this->addColumn('DISCOUNT_VALUE', 'DiscountValue', 'DECIMAL', false, 20, null);
        $this->addColumn('DISCOUNT_PERCENTAGE', 'DiscountPercentage', 'DECIMAL', false, 20, null);
        $this->addColumn('CAR_VALUE', 'CarValue', 'DECIMAL', false, 20, null);
        $this->addColumn('DEDUCTION_VALUE', 'DeductionValue', 'DECIMAL', false, 20, null);
        $this->addColumn('IS_DEFAULT', 'IsDefault', 'TINYINT', true, 1, 0);
        $this->addColumn('CREATED', 'Created', 'TIMESTAMP', true, 16, null);
        $this->addColumn('MODIFIED', 'Modified', 'TIMESTAMP', false, 16, null);
        // validators
    } // initialize()

    /**
     * Build the RelationMap objects for this table relationships
     */
    public function buildRelations()
    {
        $this->addRelation('CarDamages', 'DamagesCarDamages', RelationMap::MANY_TO_ONE, array('car_damage_id' => 'id', ), null, null);
        $this->addRelation('Attachments', 'DamagesAttachments', RelationMap::MANY_TO_ONE, array('attachment_id' => 'id', ), null, null);
    } // buildRelations()

} // DamagesEstimatedBudgetsTableMap
